<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
  </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue';
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /src
import apiRequest from "@/service";

interface dataType<T = any> {
  code: number,
  data: T,
  message: string
}

onMounted(() => {
  apiRequest.request<dataType>({
    url: '/category/list',
    method: 'GET'
  }).then(res => {
    console.log(res, "homeRes")
  })
})
</script>